Homework 6: Multi-level Cache Simulator

Computer Architecture I ShanghaiTech University

Introduction

Exploiting locality in the memory access with data cache is one of the key idea in CS110 Computer Architecture. In this homework, you are going to implement a two-level cache simulator. You can get the template code here

File structure

You should see files below in your starter code.

Specification

Structure Specification

We describe the meaning of some selected variables inside main structs here.

Functions Specification

We describe the usage, parameters and returns for some functions here.

Task Description

You are required to implement a 2-level cache in this homework. To simplify the task, we divide it into 2 parts

Part 1: single-level cache

In this part, you are going to implement a cache simultor with only a L1 cache. Your cache simulator should:

You are required to follow some rules:

To simplify your task and the grading, we provide a flow chart here to show the working process of write-back and write-through cache. Please strictly follow this process while implementing your simultor.

Part 2: two-level cache

In part2, you are going to extend your simulator to a 2-level cache simulator. Each cache in a 2-level cache system should behave individually and follows the rules mentioned in part1.

Except those rules in part1, there are some additional rules for this part:

Test

We provide a simple test dot_test in main.c. You can refer to it for how we test your simulator. The final test cases will be in the similar form. You are also highly recommend to write your own test cases by converting conventional applications into those using cache simulator interfaces. we will test whether you implement write through policy correctly by directly checking the memory

Submission

You should submit your code via Github. Please follow the guidance in Gradescope to submit your codes on Github.


In Homework 6 are,
Chundong Wang <wangchd AT shanghaitech.edu.cn>
Siting Liu <liust AT shanghaitech.edu.cn>
and,
Linjie Ma <malj AT shanghaitech.edu.cn>
Qing Xu <xuqing2 AT shanghaitech.edu.cn>

Last modified: